# -*- coding: utf-8 -*-
# @Date：2024/10/4 16:37:09
# @Author：CJiaの青姝
# @FileName：cj_compare
# @Editor：PyCharm2024
# @Remark：
def compare_version(version1, version2):
    v1 = version1.split('.')
    v2 = version2.split('.')
    while v1 and v2:
        num1 = int(v1.pop(0))
        num2 = int(v2.pop(0))
        if num1 < num2:
            return -1
        if num1 > num2:
            return 1
    if not v1:
        if not v2:
            return 0
        else:
            return -1
    else:
        return 1
